package org.linlinjava.litemall.admin.web2.goods.resp;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.linlinjava.litemall.core.util.DateTimeUtil;
import org.linlinjava.litemall.db.domain.TGoods;
import org.linlinjava.litemall.db.util.Str;

@ApiModel
public class GResp7 {

    @ApiModelProperty("id")
    private Integer id;
    @ApiModelProperty("名称")
    private String name;
    @ApiModelProperty("图片")
    private String img;
    @ApiModelProperty("分类")
    private String catalog;

    @ApiModelProperty("价格")
    private Double currentPrice;
    @ApiModelProperty("创建时间")
    private String createTime;


    public GResp7(TGoods goods) {
        id = goods.getId();
        name = goods.getMainTitle();
        img = goods.getMainPic();
        currentPrice = goods.getCurrentPrice().doubleValue();
        createTime = goods.getCreatedTime().format(DateTimeUtil.format);
    }

    public GResp7() {
    }


    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getImg() {
        return img;
    }

    public void setImg(String img) {
        this.img = img;
    }

    public String getCatalog() {
        return catalog;
    }

    public void setCatalog(String catalog) {
        this.catalog = catalog;
        if (Str.isEmpty(catalog))
            this.catalog = catalog;
    }

    public Double getCurrentPrice() {
        return currentPrice;
    }

    public void setCurrentPrice(Double currentPrice) {
        this.currentPrice = currentPrice;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }
}
